home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Interactive Web Graphics with Shout 3D
/
Interactive Web Graphics With Shout 3D.iso
/
pc
/
Code
/
Chapter08
/
TemplatePanel.java
< prev
next >
Wrap
Text File
|
2000-05-23
|
1KB
|
75 lines
package applets;
import shout3d.*;
import shout3d.core.*;
import shout3d.math.*;
public class TemplatePanel extends Shout3DPanel implements DeviceObserver, RenderObserver{
//fields to be placed here
//the constructor
public TemplatePanel (Shout3DApplet applet){
super(applet);
}
//called immediately after scene is loaded
public void customInitialize() {
addDeviceObserver(this,"MouseInput", null);
getRenderer().addRenderObserver(this, null);
}
//cleanup actions performed when viewer closes applet
protected void finalize() {
removeDeviceObserver(this,"MouseInput");
getRenderer().removeRenderObserver(this);
}
//method from DeviceObserver interface,
// used to handle user input--
//will only recieve mouse input as registered
public boolean onDeviceInput(DeviceInput di, Object userData) {
return false;
}
//method from RenderObserver interface,
// called before each frame is rendered
public void onPreRender (Renderer r, Object o) {
}
//method from RenderObserver interface,
// called after each frame is rendered
public void onPostRender (Renderer r, Object o) {
}
} //end of class